<style>
</style>
<template>
    <div>
        <Form :model="major" :label-width="90" label-position="left">
            <Row>
                <Col span="12">
                <FormItem label="专业编码">
                    <Input v-model="major.mjId" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="国家专业编码">
                    <Select v-model="major.nmId" filterable style="width: 90%;float: left;">
                        <Option v-for="item in nmIdList" :value="item.nmId" :key="item.nmId" :label="item.nmId">
                            <span>{{item.nmId}}</span>
                            <span style="float:right;color:#808695">{{item.nmName}}</span>
                        </Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="专业名称">
                    <Input v-model="major.mjName" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="学历层次">
                    <Select v-model="major.mjLevel" style="width: 90%;float: left;">
                        <Option value="博士">博士</Option>
                        <Option value="硕士">硕士</Option>
                        <Option value="本科">本科</Option>
                        <Option value="专科">专科</Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="专业简介">
                    <Input v-model="major.mjIntro" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="专业类型">
                    <Select v-model="major.mjType" style="width: 90%;float: left;">
                        <Option value="基础科段">基础科段</Option>
                        <Option value="专科段">专科段</Option>
                        <Option value="本科段">本科段</Option>
                        <Option value="独立本科段">独立本科段</Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="开考形式">
                    <Select v-model="major.mjExamform" style="width: 90%;float: left;">
                        <Option value="面向社会">面向社会</Option>
                        <Option value="面向高校">面向高校</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="第一主考院校">
                    <Select v-model="major.mjFirstexaminer" filterable style="width: 90%;float: left;">
                        <Option v-for="item in schoolList" :value="item.scId" :key="item.scName">{{ item.scName }}
                        </Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="首次开考考次">
                    <Input v-model="major.mjFirstes" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="批准文号">
                    <Input v-model="major.mjApprnum" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="停止新生注册考次">
                    <Input v-model="major.mjStopnbes" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="停止注册文号">
                    <Input v-model="major.mjStopes" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="停止报考考次">
                    <Input v-model="major.mjStopreges" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="停止报考文号">
                    <Input v-model="major.mjStopregnum" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="停止颁发毕业证日期">
                    <DatePicker @on-change="major.mjStopawdip=$event" type="date" placeholder="选择日期"
                        style="width: 90%;float: left;" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="停止颁发文号">
                    <Input v-model="major.mjStopawnum" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="专业状态">
                    <Select v-model="major.mjState" style="width: 90%;float: left;">
                        <Option value="正常">正常</Option>
                        <Option value="停考">停考</Option>
                        <Option value="即将停考">即将停考</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="总学分">
                    <Input v-model="major.mjTotalcredit" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="毕业学分">
                    <Input v-model="major.mjGradcredit" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="总课程数">
                    <Input v-model="major.mjTotalcourse" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="是否分方向">
                    <Select v-model="major.mjIfdiv" style="width: 90%;float: left">
                        <Option value="1" label="是">是</Option>
                        <Option value="0" label="否">否</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="专业大类">
                    <Select v-model="major.mcId" filterable style="width: 90%;float: left">
                        <Option v-for="item in classList" :value="item.mcName" :key="item.mcName">{{ item.mcName }}
                        </Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="报考条件说明">
                    <Input v-model="major.mjRegexplain" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="毕业条件说明">
                    <Input v-model="major.mjGradexplain" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="计划版本">
                    <Select v-model="major.mvId" filterable style="width: 90%;float: left;">
                        <Option v-for="item in mvIdList" :value="item.mvId" :key="item.mvName">{{ item.mvName }}
                        </Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="备注">
                    <Input v-model="major.mjRemark" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
        </Form>
    </div>

</template>

<script>
    export default {
        data() {
            return {
                major: {},
                nmIdList: [],
                schoolList: [],
                classList: [],
                mvIdList: []
            }

        },
        created() {
            this.$axios.get(this.$host + '/professional/management/allNationalwideMajor?pageNum=1&&pageSize=99999').then(res => {
                this.nmIdList = res.data.data.list
            })
            this.$axios.get(this.$host + '/school/allSchools?pageNum=1&&pageSize=99999').then(res => {
                this.schoolList = res.data.data.list
            })
            this.$axios.get(this.$host + '/professional/management/allMajorClasses?pageNum=1&&pageSize=99999').then(res => {
                this.classList = res.data.data.list
            })
            this.$axios.get(this.$host + '/professional/plan/majorVersions?pageNum=1&&pageSize=99999').then(res => {
                this.mvIdList = res.data.data.list
            })
        },
        watch: {
            major: {
                handler() {
                    this.trans()
                },
                deep: true
            }
        },
        methods: {
            trans() {
                this.$emit('getMajor', this.major)
            }
        }
    }
</script>